import {
	getRequest,
	postRequest,
	putRequest
} from '@/utils/http.ts'

/**维保任务*/
export const getTaskLists = (data, params) => {
	return getRequest(`/wb/app/wbPlan/selectUserMaintainInfoPage?planName=${data}`, params)
}

/** 修改任务时间*/
export const changeTaskTime = (data) => {
	return postRequest('/wb/app/wbPlan/updateTime', data)
}

/**我已到达*/
export const imReach = (data) => {
	return getRequest(`/wb/app/wbPlan/arrive?planId=${data}`)
}

/**维保表单目录*/
export const getCatalogueList = (data) => {
	return getRequest(`/wb/wbPlanClassify/getCatalogueItemByPlanId?planId=${data}&isCheckedStatus=${true}`)
}

/**年度维保表单目录*/
export const getCatalogueYearList = (data) => {
	return getRequest(`/system/year/getCatalogueYearItemByPlanId?planId=${data}`)
}

/**提交任务*/
export const submitForm = data => {
	return postRequest('/wb/app/wbPlan/submitJob', data)
}

/**反馈提交*/
export const updatePlanForm = data => {
	return putRequest('/wb/wbPlan', data)
}

//反馈回显 
export const wbPlanByIdGet = id => {
	return getRequest('/wb/wbPlan/' + id)
}

/**提交年度任务(诺贝尔)*/
export const submitYearForm = data => {
	return putRequest('/system/three/batchEdit', data)
}

/**上传凭条*/
export const submitReceipt = data => {
	return postRequest('/wb/app/wbPlan/entrySlip', data)
}

/**获取凭条详情*/
export const getReceipt = data => {
	return getRequest('/wb/app/wbPlan/getPlanInfoById', data)
}

/**维保审核*/
export const getCheckLists = data => {
	return getRequest(`/wb/app/wbPlan/selectUserAuditPage?execStatus=${data}`)
}

/**统计维保审核数量*/
export const statisticsMaintenanceAuditNumber = data => {
	return getRequest('/wb/app/wbPlan/statisticsMaintenanceAuditNumber')
}

/**审核通过*/
export const planAudit = data => {
	return postRequest('/wb/app/wbPlan/planAudit', data)
}
/**审核驳回*/
export const checkReject = data => {
	return postRequest('/wb/app/wbPlan/reject', data)
}

/**修改目录名称*/
export const catalogueChange = data => putRequest('/wb/wbPlanClassify', data)
/**修改年度目录名称 (诺贝尔)*/
export const catalogueYearChange = data => putRequest('/system/content', data)

/** 工程检测提交保存 */
export const saveCatalog = data => postRequest('/wb/app/wbPlan/saveCatalog', data)

/**有没有新增过 */
export const allListByCreateBy = data => getRequest('/system/year/allListByCreateBy', data)

/**获取年度模版*/
export const getAllList = data => getRequest('/system/WbClassifyYear/allList', data)

/**查詢完後新增 */
export const saveCatalogNew = data => postRequest('/wb/app/wbPlan/saveCatalog ', data)

/**修改三级 */
export const batchEdit = data => putRequest('/system/three/batchEdit', data)

/**修改二级*/
// export const catalogueYearChange = data => putRequest('/system/content', data)